package com.lntea.security.crc;

import java.util.zip.Adler32;
import java.util.zip.CRC32;

public class LnteaCRC {
	private static String message = "lntea crc32";
	public static void main(String[] args) {
		jdkCRC();
		
		jdkAdler32();
	}
	
	public static void jdkCRC(){
		CRC32 crc32 = new CRC32();
		crc32.update(message.getBytes());
		String result = Long.toHexString(crc32.getValue());
		System.out.println("jdk crc32:"+result);
	}
	
	public static void jdkAdler32(){
		Adler32 adler32 = new Adler32();
		adler32.update(message.getBytes());
		String result = Long.toHexString(adler32.getValue());
		System.out.println("jdk adler32:"+result);
	}
}
